﻿using System.ComponentModel;
using Tetris.Game.ControlsBase.Common;

namespace Tetris.Game.ControlsBase
{
    [ToolboxItem(true)]
    [Shape(true, ShapeType.J)]
    public class JShape : TetrisShapeBase
    {
        public JShape()
        {
            this.TetrisShapeType = ShapeType.J;
            Size = this.TetrisShapeType.GetShapeDefaultSize();
            TetrisShapeColor = this.TetrisShapeType.GetShapeColor();
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
        }

        protected override void PaintBlocks(Graphics g)
        {
            int blockSize = this.Size.Width / 3;
            BlockSize = blockSize;
            int w = blockSize * 3;
            this.Size = new Size(w, blockSize << 1);
            PaintBlock(g, 2 * blockSize, 0, blockSize, blockSize);
            for (int i = 0; i < 3; i++)
            {
                PaintBlock(g, i * blockSize, blockSize, blockSize, blockSize);
            }
        }
    }
}
